//
//  SYP_DrawerHeadView.m
//  wind
//
//  Created by SYP on 16/1/14.
//  Copyright © 2016年 李金明. All rights reserved.
//

#pragma 头像的大小位置

#define HEADLEFT (30)  // 头像左侧距离
#define HEADTOP (40)  //头像上侧距离
#define HEADSIZE (40)  // 头像大小
#define CENTER (60)   // 头像和昵称的距离
#define NAMEWIDTH (70)  // 昵称的宽度
#define NAMEHEIGHT (30) // 昵称的高度


#import "SYP_DrawerHeadView.h"
#import "Masonry.h"


@implementation SYP_DrawerHeadView

- (void)creatSubviews
{
    [self creatViews];
}

-(void)creatViews
{
    
#pragma 图像
    UIImageView *userImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"53619e72cc972664.png!200x200"]];
    userImageV.frame = CGRectMake(HEADLEFT * SCREEN_ONE, HEADTOP * SCREEN_ONE, HEADSIZE * SCREEN_ONE, HEADSIZE * SCREEN_ONE);
    userImageV.layer.masksToBounds = YES;
    userImageV.layer.cornerRadius = HEADSIZE * SCREEN_ONE / 2;
    [self addSubview:userImageV];
    [userImageV release];
    
#pragma 昵称
    UILabel *userName = [[UILabel alloc] init];
    userName.text = @"暮雨泽";
    userName.textColor = [UIColor whiteColor];
    [self addSubview:userName];
    
    [userName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(userImageV.mas_centerY);
        make.left.equalTo(userImageV.mas_left).with.offset(CENTER);
        make.width.mas_equalTo(NAMEWIDTH);
        make.height.mas_equalTo(NAMEHEIGHT);
        
    }];
}


@end
